<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>收货地址</title>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>

<div class="layui-panel" style="padding: 8px;">
    <fieldset class="layui-elem-field layui-border-blue">
        <legend>搜索信息</legend>
        <form class="layui-form layui-form-pane" style="margin: 20px;">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" type="text" name="name" autocomplete="off" />
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <a class="layui-btn layui-btn-primary" lay-submit="" lay-filter="searchBtn">
                            <i class="layui-icon layui-icon-search"></i>
                            搜索
                        </a>
                    </div>
                </div>
            </div>
        </form>
    </fieldset>
    <div>
        <table id="addressTable" lay-filter="addressTable"></table>
    </div>
</div>
<script id="tool" type="text/html">
    {{# if(d.isUpdate==0){ }}
    <a class="layui-btn layui-btn-warm layui-btn-xs"  lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
    {{# }}}
</script>

<script id="tableBar" type="text/html">
    <a class="layui-btn  layui-btn-md" lay-event="excel">
        <i class="layui-icon layui-icon-export"></i>
        导出为Excel文件
    </a>
</script>

<script>
    var $,active;
    layui.use(['table','form','jquery','layer'],function(){
        var table = layui.table,layer = layui.layer,form = layui.form;
        $ = layui.jquery;

        //加载表格
        table.render({
            elem:'#addressTable',
            height:'full-160',
            page:true,
            toolbar:'#tableBar',
            defaultToolbar: ['filter', 'exports', 'print'],
            url:'/system/ac/find',
            cols:[
                [
                    {type:'numbers',fixed:'left',align: 'center',title: '编号'},
                    {type:'checkbox',fixed:'left',align: 'center',},
                    {field:'mid',title:'收货人',width:120,align: 'center',style:'color: #00B7FF;font-size:12pt;font-weight: bold'},
                    {field:'province',title:'省(直辖市、自治区)',width:180,align: 'center',style:' background-color:#eedeb0; color: #00B7FF;font-size:12pt;font-weight: bold;'},
                    {field:'city',title:'市(县)',width:100,align: 'center',style:'color: #00B7FF;font-size:12pt;font-weight: bold'},
                    {field:'area',title:'区',width:120,align: 'center',style:'color: #00B7FF;font-size:12pt;font-weight: bold'},
                    {field:'detailAddress',title:'详细地址',width:550,align:'center',style:'color: #00B7FF;font-size:12pt;font-weight: bold'},
                    {field:'createTime',title:'创建时间',width:250,align: 'center',style:'color: #00B7FF;font-size:12pt;font-weight: bold'},
                    {field:'defaultCheck',title:'默认',
                        templet:function (a) {
                            if (a.defaultCheck==0){
                                return "<span style='color: #ff2d51;font-size: 15pt;font-weight: bold'>默认..嘿嘿嘿🤤🤤</span>"
                            }else if (a.defaultCheck==1){
                                return "非默认";
                            }
                        },
                        width:200,align: 'center'},
                ]
            ]
        })


        //监听搜索按钮
        form.on('submit(searchBtn)',function(data){
            var dataForm = data.field;
            console.log(dataForm);
        })



    });
</script>



</body>
</html>

